<!doctype html>
<html  class="x-admin-sm">
<head>
	<meta charset="UTF-8">
	<title>{$list['webtitle']} {$list['version']}</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta name="keywords" content="码蚁成绩,成绩管理,成绩统计,成绩分析,成绩查看">
    <meta name="description" content="适合自己的才是最好的！">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="__XADMIN__/css/font.css">
    <link rel="stylesheet" href="__XADMIN__/css/login.css">
	  <link rel="stylesheet" href="__XADMIN__/css/xadmin.css">
    <script type="text/javascript" src="__XADMIN__/js/jquery.min.js"></script>
    <script src="__XADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script src="__XADMIN__/lib/layui/sliderVerify.js" charset="utf-8"></script>
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <!-- // 百度统计代码  -->
        <script>
          var _hmt = _hmt || [];
          (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?6f65eecea5e089dae94d6b9cffec3623";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
          })();
        </script>
</head>
<body class="login-bg">
    <div class="login layui-anim layui-anim-up">
        <div class="message">{$list['webtitle']} {$list['version']}</div>
        <div id="darkbannerwrap"></div>
        <form method="post" class="layui-form" >
            <input name="username" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input" autocomplete="off">
            <hr class="hr15" id="thisafter">

              <div class="layui-form-item" style="margin-left:0px; margin-bottom: 0px;">
                <div id="slider" style="height: 50px"></div>
              </div>
            <hr class="hr15">
            <a href="/login/student" class="layui-btn layui-btn-danger" style="width:23%;height: 48px;font-size: 14px;padding-top: 7px;">学生入口</a>
            <a href="/login/teacher" class="layui-btn layui-btn-danger" style="width:23%;height: 48px;font-size: 14px;padding-top: 7px; margin-left: 1px">教师入口</a>
            <input value="管理员登录" lay-submit lay-filter="login" style="width:49%; float: right;" type="submit">
            <hr class="hr20" >
        </form>
    </div>
    <script type="text/javascript" charset="utf-8">
      layui.config({
        base: '__XADMIN__/lib/layui/'
      }).extend({
        sliderVerify:'sliderVerify'
      }).use(['sliderVerify', 'jquery', 'form'], function() {
        var sliderVerify = layui.sliderVerify,
          form = layui.form;

        mobile = "{$list['mobile']}";
        if(mobile!==true)
        {
          var slider = sliderVerify.render({
            elem: '#slider',
            onOk: function(){
              //当验证通过回调
              // layer.msg("滑块验证通过");
            },
          })
        }

        //监听提交
        form.on('submit(login)', function(data){
          mobile = "{$list['mobile']}";
          if(mobile == true)
          {
            yz = true
          }else{
            yz = slider.isOk();
          }

          if(yz){
            $.post("/login",data.field,function(data,status){
                  if(status != 'success')
                  {
                    layer.msg('数据传输错误');
                    $('#captchaimg').onclick();
                    $('#captcha').val('');
                    $('#password').val('');
                    slider.reset();
                  }
                  if(data.status == 1)
                  {
                    window.location.href="/";
                  }else{
                    layer.msg(data.msg);
                    $('#captchaimg').click();
                    $('#captcha').val('');
                    $('#password').val('');
                    slider.reset();
                  }
                });
                return false;
          }else{
            layer.msg("请先通过滑块验证");
          }
          return false;
        });
      })


      function tiaozhuan()
      {
        layer.msg('');
      }


    </script>


</body>
</html>
